//
//  ViewController.m
//  UI_24_加密
//
//  Created by li cheng on 16/8/16.
//  Copyright © 2016年 li cheng. All rights reserved.
//

#import "ViewController.h"
#import "NSString+LCMD5.h"
#import "NSString+LCSHA_1.h"
#import "NSString+LCBase64.h"
#import "NSString+LCDES.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    // MD5 SHA-1 单向散列函数, 验证算法, 一般用于验证密码
    // 1
    NSString *afterMD5 = @"Hello, 12345678";
    NSString *finakeMD5 = [afterMD5 stringWith32BitMD5Lower];
    NSLog(@"%@", finakeMD5);
    NSString *final32BitLowerMD5 = [afterMD5 stringWith32BitMD5Lower];
    NSString *final32BitUpperMD5 = [afterMD5 stringWith32BitMD5Upper];
    NSString *final16BitLowerMD5 = [afterMD5 stringWith16BitMD5Lower];
    NSString *final116BitUpperMD5 = [afterMD5 stringWith16BitMD5Upper];
    NSLog(@"+++++++++++++++++++++++++++++++++++++++++++++++++++%@--%@__%@--%@", final32BitLowerMD5, final32BitUpperMD5, final16BitLowerMD5, final116BitUpperMD5);
    // 2.SHA-1
    NSString *afterSHA_1 = @"HELLO";
    NSString *finalSHA_1String = [afterSHA_1 stringWithSHA_1];
    NSLog(@"%@", finalSHA_1String);
    // 3. base64
    NSString *afterBase64 = @"Hello";
    NSString *base64 = [afterBase64 stringWithBase64];
    NSLog(@"%@", base64);
    NSString *finalBase64 = [base64 base64WithString];
    NSLog(@"%@",finalBase64);
    // 4. 对称密码
    // 三种算法, DES 3重DES . AES
    NSString *string = @"123456789";
    NSString *desString = [string stringWithDES];
    NSLog(@"%@", desString);
    NSString *finalString = [desString desWithString];
    NSLog(@"%@", finalString);
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
